#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
const int maxn = 1e5+10;
const int mod = 1e9+7;
const int INF = 0x3f3f3f3f;
int d[4][2]={1,0,0,1,-1,0,0,-1};
int main() {
    ios::sync_with_stdio(0);
    #ifdef Uncle_drew
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #else
    #endif
    ll mid=0,mi=0,flag=0,ans=0,er=0;
    string s;
    cin>>s;
    int l=s.size();
    for(int i=0;i<l;i++){
        if(s[i]=='d'){
            flag=1;
        }else if(s[i]=='+'){
            ans+=mi*(mid+1)/2;
            if(mi*(mid+1)&1)    er++;
            flag=mid=mi=0;
        }else if(flag){
            mid=s[i]-'0'+mid*10;
        }else{
            mi=s[i]-'0'+mi*10;
        }
    }
    if(mid&&mi){
        ans+=mi*(mid+1)/2;
        if(mi*(mid+1)&1)    er++;
    }else if(mi){
        ans+=mi;
    }
    if(er&1){
        cout<<ans+er/2<<".5\n";
    }else{
        cout<<ans+er/2<<endl;
    }
    return 0;
}